<div id="content-outer">
  <div id="content">
    <div id="page-heading"><h1>Create Ticket</h1></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <?php //echo $this->Html->image('../images/shared/side_shadowleft.jpg', array('alt' => '', 'width' => '20', 'height' => '300')); ?>
            </th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized">
                <?php //echo $this->Html->image('../images/shared/side_shadowright.jpg', array('alt' => '', 'width' => '20', 'height' => '300')); ?>
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left"></td>
            <td>
                <div id="content-table-inner">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                              <?php echo $this->Form->create("Ticket", array('action' => 'enquiry', 'class' => 'form')); ?>
                               <?php echo $this->Session->flash(); ?>  
                                <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
                                  <tr>
                                      <th valign="top">First name <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('first_name', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'value'       =>  isset($customer['Customer']['f_name'])?$customer['Customer']['f_name']:"",
                                                                  'class'     => 'inp-form med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Last name <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('last_name', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'value'       =>  isset($customer['Customer']['l_name'])?$customer['Customer']['l_name']:"",
                                                                  'class'     => 'inp-form med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Email <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('email', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'value'       =>  isset($customer['Customer']['email'])?$customer['Customer']['email']:"",
                                                                  'class'     => 'inp-form med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Phone <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('mobile', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'value'       =>  isset($customer['Customer']['mobile'])?$customer['Customer']['mobile']:"",
                                                                  'class'     => 'inp-form med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Country <span class="red">*</span></th>
                                      <td>
                                          <?php
                                          $this->request->data['Ticket']['country_id']=$customer['Customer']['country_id'];
                                            $this->request->data['Ticket']['city_id']=$customer['Customer']['city_id'];
                                            ?>
                                          <script type="text/javascript">
                                              $(document).ready(function(){
                                                  $("#TicketCountryId").chosen().change(function(){
                                                      get_city("<?php echo 'Ticket' ?>",$(this).val(),0);
                                                  });
                                                  <?php
                                                  if(isset($this->request->data['Ticket']['country_id'])&&isset($this->request->data['Ticket']['city_id'])&&$this->request->data['Ticket']['country_id']!=0&&$this->request->data['Ticket']['city_id']!=0){ ?>
                                                          get_city("<?php echo 'Ticket' ?>",'<?=$this->request->data['Ticket']['country_id']?>', '<?=$this->request->data['Ticket']['city_id']?>');
                                                  <?php }
                                                  ?>
                                              });
                                          </script>
                                      <?php
                                      echo $this->Form->input('country_id', array(
                                                          'label'     => false,
                                                          'div'       => false,
                                                          'empty'     =>'',
                                                          'data-placeholder'=>'Select a country',
                                                          'options'   =>$countries,
                                                          'class'     => 'chosen med')
                                          );
                                      ?>
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">City <span class="red">*</span></th>
                                      <td id="city-update">
                                        <?php
                                          echo $this->Form->input('city_id', array(
                                                              'label'     => false,
                                                              'div'       => false,
                                                              'empty'     =>'',
                                                              'data-placeholder'=>'Select a city',
                                                              'type'      =>'select',
                                                              'class'     => 'chosen med')
                                              );
                                        ?>
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Subject <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('subject', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'class'     => 'inp-form med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th valign="top">Description <span class="red">*</span></th>
                                      <td>
                                          <?php
                                              echo $this->Form->input('description', array(
                                                                  'label'     => false,
                                                                  'div'       => false,
                                                                  'type'      => 'textarea',
                                                                  'class'     => 'med')
                                                  );     
                                          ?>      
                                      </td>
                                      <td></td> 
                                  </tr>
                                  <tr>
                                      <th><span class="red">*</span> Fields are mandatory</th>
                                      <td valign="top">&nbsp;</td>
                                      <td></td>
                                  </tr>
                                  <tr>
                                      <th>&nbsp;</th>
                                      <td valign="top">
                                          <?php echo $this->Form->submit('Submit', array('class' => 'submit-button','div'=>false,'label'=>false)); ?>
                                                <?php echo $this->Html->link('Cancel', "/", array('class' => 'cancel-button')); ?>
                                      </td>
                                      <td></td>
                                  </tr>
                                </table>
                            <?php echo $this->Form->end();?>    
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                               <?php echo $this->Html->image('../images/shared/blank.gif', array('alt' => 'blank', 'width' => '695', 'height' => '1')); ?>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                    <div class="clear"></div>
                </div>
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>
    <div class="clear">&nbsp;</div>
  </div>
</div>
<script type="text/javascript">
  $(document).ready(function() {
    $("#ticketsMenu").addClass("current");
  });
</script>